package com.ruoyi.web.controller.system;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.IRecordsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(tags = "考勤记录管理")
@RestController
@RequestMapping("/system/records")
public class RecordsController extends BaseController {

    @Autowired
    private IRecordsService recordsService;

    @GetMapping("/deptStats")
    @ApiOperation("获取部门考勤统计数据")
    public AjaxResult getDeptAttendanceStats(@RequestParam(required = false) String deptName) {
        return AjaxResult.success(recordsService.selectDeptAttendanceStats(deptName));
    }
}